import { ref } from "vue";
const response = ref({});


export async function getCircuitFetch(params) {
  let requestOptions;
  if (params) {
    requestOptions = {
      method: "GET",
      headers: { "Content-Type": "application/json" },
      params: JSON.stringify(params),
    };
  }

  try {
    const request = await fetch(
      "http://10.70.223.58:11000/find_circuit_diagram_name",
      requestOptions ? requestOptions : null
    );
    response.value = await request.json();
    return response;
  } catch (error) {
    return error;
  }
}
